<%@ page contentType="text/html; charset=utf-8" import="java.net.InetAddress,common.*,java.sql.*,db.*,java.util.*"%>
<%
String ent_id= (String)session.getAttribute("ent_id");
String search_gubun= request.getParameter("search_gubun")==null?"":request.getParameter("search_gubun");
String search_word = CommonUtil.nvl(request.getParameter("search_word"));
String search_flag =CommonUtil.nvl(request.getParameter("search_flag"));

Connection con=null;
ArrayList list =null;
ArrayList list2 =null;
HashMap userMap = new HashMap();
try {
	
	con = (new CommonConnect()).getConnection_ds1();
	String[] param=null;
	String[] param2=null;
	String queryStr ="";
	String queryStr2 = "";
//메인페이지의 리스트 내역을 가져온다.
	param= new String[4];
	param[0] = ent_id;
	param[1] = search_word;
	param[2] = search_gubun;
	param[3] = search_flag;
	
	queryStr = "call stu_edu1401List(?, ? ,?,?)";	
	list = DAO.select(con,queryStr,param);
	
	param2= new String[1];
	param2[0] = ent_id;
	queryStr2 =  "call stu_edu1401Tree(?)";
	list2 = DAO.select(con,queryStr2,param2);
	
	//System.out.println(list);
	
} catch (Exception e) {
	e.printStackTrace();
}finally {
	  try{
		  if (con!=null) con.close();
	  }catch(Exception ee){}
}
%>
<jsp:include page="/mobile/common/head.jsp"></jsp:include>

<body>
<div data-role="page" id="page_main" >  
      
        <div data-role="header"   data-backbtn="true">  
        <h1>과정 목록</h1>   
        </div>  
  
        <div data-role="content" >  
            <ul data-role="listview"  data-dividertheme="b">  <!-- data-filter="true" data-inset="true" --> 
                    <li data-role="list-divider">뽀로로 </li>
                    <li><a href="http://contents.huvation.com:8080/pororo.mp4">뽀로로 동영상 샘플</a></li> 
                     
                     <%
						for (int i=0; list2!=null && list2.size() > i; i++){
							HashMap map = (HashMap)list2.get(i);
														
							if("1".equals((String)map.get("rn")) ){
								
					%>	
                     
                     <li data-role="list-divider"><%=(String)map.get("cate_nm") %> </li>
                    <%		
			                    for (int j=0; list!=null && list.size() > j; j++){
									HashMap map2 = (HashMap)list.get(j);
									if(map.get("cate_nm").equals(map2.get("ccate_nm"))){ 
									
					%>
					<li><a href="index.html"><%= (String)map2.get("poi_nm")%></a></li> 
					<%				
									}
								}
							}
						}
					%>    
                    
                       
            </ul>  
         </div> 
         
         <jsp:include page="/mobile/common/footer.jsp"></jsp:include> 
          
</div> 


</body>
</html>
